Skip to content

fix: remove dead audit/graph surface, surface LLM errors, FailOn contract - #32

Merged
Patel230 merged 7 commits into
mainfrom
fix/audit-sweep-2026-08
Aug 16, 2026
Merged

fix: remove dead audit/graph surface, surface LLM errors, FailOn contract#32
Patel230 merged 7 commits into
mainfrom
fix/audit-sweep-2026-08

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Summary

  • Removed dead WithGraph/WithAuditMode/WithAuditTargets options and the entirely-unused internal/graph + internal/audit packages (−1,589 lines). Zero workspace importers found.
  • LLM errors (including previously-swallowed reflection errors) now surfaced in Stats.LLMErrors and carried into contract results.
  • ToContractResult calls SetFailOn so user-configured thresholds take effect at the contract layer.
  • Magic 0.6 confidence default extracted to documented constant.

The WithGraph, WithAuditMode, and WithAuditTargets options configured
Reviewer fields (g, audit) that were never read outside NewReviewer,
and the internal/graph and internal/audit packages had zero importers.
The graph/audit .sight.toml keys fed the same dead chain via
ApplyFileConfig.

Remove the options, the AuditMode/AuditTarget/AuditTargetType/
AuditOption/ParseAuditMode types, both internal packages, the unused
Reviewer fields, the config-file keys, and the stale docs sections.
The keys were effectively no-ops, so user-visible behavior is
unchanged apart from the removed API.

BREAKING CHANGE: public options and types listed above are removed.
Review previously succeeded silently when every provider call failed:
errors were collected but only appended to the human-readable Report.
Add Stats.LLMErrors (one entry per failed concern call), surface the
swallowed self-reflection provider error under an [reflection] prefix,
and carry both through ToContractResult into the shared
hawk-core-contracts Stats.LLMErrors field so hawk can detect partial
results.
…version

ToContractResult assigned the contract Result.FailOn field directly,
leaving FailOnSet false. The shared contract's Failed() treats an
unset threshold as critical, so a user-configured below-critical
threshold (WithFailOn(High), the CI preset) was silently ignored at
the contract layer. Call SetFailOn during conversion so the
configured threshold takes effect.
toPublicFindings silently rewrote out-of-range confidence to a magic
0.6. Extract it as the documented package-level constant
defaultConfidence. No behavior change.
- go.mod: hawk-core-contracts v0.1.9 -> v0.1.13-0.20260815203243-0f60bf02
  (branch fix/audit-sweep-2026-08 of hawk-core-contracts) — needed for
  Stats.LLMErrors and Result.SetFailOn/FailOnSet used by this branch;
  re-pin to the tagged release once hawk-core-contracts#27 merges
- go.mod + CI: Go 1.26.6 — 1.26.5 stdlib has reachable vulns that fail
  govulncheck
contracts#27 squash-merged as 16ebcfd; move from the branch
pseudo-version to the merged main pseudo-version.
@Patel230
Patel230 merged commit 3955345 into main Aug 16, 2026
12 checks passed
@Patel230
Patel230 deleted the fix/audit-sweep-2026-08 branch August 17, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant